<template>
    <div class="item-card">
        <div class="item-head clear">
            <div class="fl">{{title}}</div>
            <div @click="changeStatus(index)" class="more fr">{{isShow ? '收起' : '展开'}}</div>
        </div>
        <div v-if="!isShow && title==='进度追踪'" class="introduction">
            {{process.currentProcStr}}
        </div>
        <div v-if="isShow" class="item-content">
            <slot></slot>
        </div>
    </div>
</template>

<script>
    export default {
        props: ['title', 'process', 'index', 'actListIndex'],
        data() {
            return {
                search: require('../img/input.png')
                // isShow: false
            };
        },
        computed: {
            isShow () {
                return this.index === this.actListIndex;
            }
        },
        mounted() {
            console.log(this.title);
        },
        methods: {
            changeStatus (index) {
                this.$emit('changeStatus', index);
                // this.isShow = !this.isShow;
            }
        }
    };
</script>

<style lang="less" scoped>
    @import "../css/var.less";
    .item-card{
        margin-top:.3rem;
        z-index:2;
        position:relative;
        .item-head{
            background-color:#FFF;
            height:1rem;
            line-height:1rem;
            padding:0 .2rem;
            font-size:.32rem;
        }
        .item-content{
            border-top:1px dashed @border-color;
        }
        .introduction{
            border-top:1px dashed @border-color;
            background-color:#FFF;
            padding:.3rem .5rem;
        }
        .more{
            color:@theme-color;
        }
    }
</style>
